安装
npm install --save hexo-tag-aplayer
用法
{% aplayer title author url [picture_url, narrow, autoplay, width:xxx, lrc:xxx] %}
参数
title :音乐标题
author:音乐作者
url:音乐文件网址
picture_url:可选,音乐图片网址
narrow:可选,窄款式
autoplay:可选,自动播放音乐,不支持移动浏览器
width:xxx:可选,前缀width:,播放器宽度(默认值:100%)
lrc:xxx:可选,前缀lrc:,LRC文件url
{% aplayer "Caffeine" "Jeff Williams" "caffeine.mp3" "picture.jpg" "lrc:caffeine.txt" %}
播放列表
{% aplayerlist %}
{
"narrow": false, // Optional, narrow style
"autoplay": true, // Optional, autoplay song(s), not supported by mobile browsers
"mode": "random", // Optional, play mode, can be `random` `single` `circulation`(loop) `order`(no loop), default: `circulation`
"showlrc": 3, // Optional, show lrc, can be 1, 2, 3
"mutex": true, // Optional, pause other players when this player playing
"theme": "#e6d0b2", // Optional, theme color, default: #b7daff
"preload": "metadata", // Optional, the way to load music, can be 'none' 'metadata' 'auto', default: 'auto'
"listmaxheight": "513px", // Optional, max height of play list
"music": [
{
"title": "CoCo",
"author": "Jeff Williams",
"url": "caffeine.mp3",
"pic": "caffeine.jpeg",
"lrc": "caffeine.txt"
},
{
"title": "アイロニ",
"author": "鹿乃",
"url": "irony.mp3",
"pic": "irony.jpg"
}
]
}
{% endaplayerlist %}